<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="google-site-verification" content="H4CmXk07FkVxdr8hpRFcv7pKrnjMnz6p02P96rFSxQU" />
<title>iteamjob (愛停佳) 即時停車資訊！ [台北] [台中] [高雄]</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false&language=zh_TW"></script> <!--載入Google map API V3--> 
<script type="text/javascript" src="js/place.js"></script>

<script  type="text/javascript">
 function init() {
    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    http_request = new XMLHttpRequest();
}  else if (window.ActiveXObject) { // IE
    http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
    geocoder = new google.maps.Geocoder();

    map = new google.maps.Map(document.getElementById("map_canvas"), {
      zoom: 16,
      center: new google.maps.LatLng(25.041088,121.566038),
      mapTypeId: google.maps.MapTypeId.ROADMAP
	});


	var infowindow = new google.maps.InfoWindow();

	function addMarker(latlng, title, content,content2,content3, key) {
	
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: title,
icon: 'images/GoogleMapsMarkers/parking_Marker.png'
});

google.maps.event.addListener(marker, 'click', function() {
        infowindow.setContent('<iframe src="/parking_view?k=' + key + '" frameborder="0" scrolling="no"></iframe>');
		//update使用 infowindow.setContent('<b><font color="#FF0000">' + title +'</font>' + "個空位"+" " + content + '</b><br/>' + content2 + '<br/>'+ content3 +'<a href="/parking_update?k=' + key + '">edit</a>');
		    infowindow.setPosition(latlng);
		      infowindow.open(map, marker);
		});
}
{% for p in parkings %}
		addMarker(new google.maps.LatLng({{ p.geopt }}),'{{ p.space }}','{{ p.price }}', '{{ p.name }}', '{{ p.address }}', '{{ p.key }}');
{% endfor %}
}
function showAddress(addr) {
	if (geocoder) {
		geocoder.geocode( { 'address': addr}, function(results, status) {
				if (status == google.maps.GeocoderStatus.OK) {
				map.setCenter(results[0].geometry.location);
				var marker = new google.maps.Marker({
map: map, 
position: results[0].geometry.location
});
				} else {
				alert("Geocode was not successful for the following reason: " + status);
				}
				});
}
}
 
function clearMap(){
      //alert("OO");
	  map.clearOverlays();
 
	    polyPoints = [];
	      document.getElementById("coords").value =  "&lt;-- Click on the map to digitize!";
} 

function drawCoordinates(){
   
  //Re-create Polyline/Polygon

  if (polygonMode) {
    polyShape = new google.maps.Polygon(polyPoints,lineColor,lineWeight,opacity,fillColor,opacity);
  } else {
    polyShape = new google.maps.Polyline(polyPoints,lineColor,lineWeight,opacity);
  }
  
  map.clearOverlays();

  // Grab last point of polyPoints to add marker
  marker = new google.maps.Marker(polyPoints[polyPoints.length -1]);

  map.addOverlay(marker);
  map.addOverlay(polyShape);

  logCoordinates();
}
 
function deleteLastPoint(){
      	  map.removeOverlay(polyShape);
	    // pop last element of polypoint array
	    polyPoints.pop();
	      drawCoordinates();
} 
</script> 

<script type="text/javascript">

  var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-23986139-3']);
      _gaq.push(['_trackPageview']);

        (function() {
	     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		       })();

</script>

<!-- Place this tag in your head or just before your close body tag -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

  <script>
    // 載入 master 選單，同時初始化 detail 選單內容
    function loadMaster( master, detail ) {
 
      master.options.length = country.length;
      for( i = 0; i < country.length; i++ ) {
        master.options[ i ] = new Option( country[i], country[i] );  // Option( text , value );
      }
 
      master.selectedIndex = 0;
      doNewMaster( master, detail );
    }
 
    // 當 master 選單異動時，變更 detail 選單內容
    function doNewMaster( master, detail ) {
    
      detail.options.length = city[ master.selectedIndex ].length;
      for( i = 0; i < city[ master.selectedIndex ].length; i++ ) {
        detail.options[ i ] = new Option( city[ master.selectedIndex ][ i ]['0'],
                                          city[ master.selectedIndex ][ i ]['1'] );
      }
    }
 
  </script>

</head> 

<body onload="init(); loadMaster(document.getElementById( 'country' ), document.getElementById( 'city' ));">

<center>
<form action="#" onsubmit="showAddress(this.address.value); return false"> 
 
	<p> 
	<input type="text" size="40" name="address" value="請輸入地點" onfocus="if (value == '請輸入地點') {value =''}" onblur="if (value == '') {value='請輸入地點'}"  /> 
 
	<input type="submit" value="GO" /> 
	
	<input type="button" value="Clear" onclick="clearMap();" />
	</p> 
</form>
	<table border="0" width="90%">
		<!-- <tr><td align='right'><a href='/parking_add'>Add</a></td></tr> -->
		<tr>
		    <td align='left'>
                <select name="country" id="country" onChange="doNewMaster( document.getElementById( 'country' ), document.getElementById( 'city' ) );"></select>
                <select name="city" id="city" onchange="location.href='index2?lat=' + this.options[this.options.selectedIndex].value.split(',')[0] + '&lon=' + this.options[this.options.selectedIndex].value.split(',')[1]"></select> 
            </td>
	    <td></td>
		    <td align='right'>
                <a href='/where'><b>MyLocation!</b></a> <g:plusone></g:plusone>
            </td>
		</tr>
	</table>
		
    <script type="text/javascript">
        var winWidth = window.document.body.clientWidth * 0.95;
        var winHeight = window.document.body.clientHeight * 0.85;
        document.write('<div id=\'map_canvas\' style=\'width: ' + winWidth + 'px; height: '+ winHeight + 'px;\'></div>');
        </script>

	<a target="_blank" href='http://code.google.com/p/iteamjob/issues/list'><b>連絡我們</b></a>
	<br><br>
	<font size='2' color='darkslateblue' face='標楷體'>Under Construction....</font>
</center>

</body>

</html>
